﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace RTMP
{
    public class Logger
    {
    	
		public delegate void LoggerEventHandler(object sender,string message);
    	public event LoggerEventHandler LoggerEvent;
    	public void Log(string message)
        {
			try
			{
				if(LoggerEvent!=null)    				
					LoggerEvent(this,message);
			}
			catch{}
        }

        public void LogHex(byte[] array, int offset, int count)
        {
            string result = "";
            for (int i = offset; i < offset + count; i++) result += array[i].ToString("X2") + " ";
            Log(result);
        }
    }
}
